package com.lcb.manager.vo;

import com.lcb.manager.entity.Person;

import java.sql.Date;

public class PersonVo {

    private Integer id;

    private String headImg;

    private String name;

    private int sex;

    private String sexName;

    private int race;

    private String raceName;

    private String address;

    private String state;

    private String teacherName;

    private String guardian;

    private String guardianContact;

    private Date crimeTime;

    private String crimeType;

    private String crimeDetail;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getHeadImg() {
        return headImg;
    }

    public void setHeadImg(String headImg) {
        this.headImg = headImg;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getSex() {
        return sex;
    }
    public void setSex(int sex) {
        this.sex = sex;
    }

    public String getSexName() {
        return sexName;
    }

    public void setSexName(String sexName) {
        this.sexName = sexName;
    }

    public int getRace() {
        return race;
    }

    public void setRace(int race) {
        this.race = race;
    }

    public String getRaceName() {
        return raceName;
    }

    public void setRaceName(String raceName) {
        this.raceName = raceName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    public String getGuardian() {
        return guardian;
    }

    public void setGuardian(String guardian) {
        this.guardian = guardian;
    }

    public String getGuardianContact() {
        return guardianContact;
    }

    public void setGuardianContact(String guardianContact) {
        this.guardianContact = guardianContact;
    }

    public Date getCrimeTime() {
        return crimeTime;
    }

    public void setCrimeTime(Date crimeTime) {
        this.crimeTime = crimeTime;
    }

    public String getCrimeType() {
        return crimeType;
    }

    public void setCrimeType(String crimeType) {
        this.crimeType = crimeType;
    }

    public String getCrimeDetail() {
        return crimeDetail;
    }

    public void setCrimeDetail(String crimeDetail) {
        this.crimeDetail = crimeDetail;
    }

    public static PersonVo fromEntity(Person person) {
        if (person == null) return null;
        PersonVo personVo = new PersonVo();
        personVo.id = person.getId();
        personVo.headImg = person.getHeadImg();
        personVo.name = person.getName();
        personVo.sex = person.getSex();
        personVo.sexName = person.getSex() == 0 ? "男" : "女";
        personVo.race = person.getRace();
        switch (person.getRace()) {
            case 0:
                personVo.raceName = "汉族";
                break;
            case 1:
                personVo.raceName = "满族";
                break;
            case 2:
                personVo.raceName = "蒙古族";
                break;
            case 3:
                personVo.raceName = "回族";
                break;
            case 4:
                personVo.raceName = "藏族";
                break;
            case 5:
                personVo.raceName = "维吾尔族";
                break;
            case 6:
                personVo.raceName = "苗族";
                break;
            case 7:
                personVo.raceName = " 彝族";
                break;
            case 8:
                personVo.raceName = "壮族";
                break;
            case 9:
                personVo.raceName = "布依族";
                break;
            case 10:
                personVo.raceName = "侗族";
                break;
            case 11:
                personVo.raceName = "瑶族";
                break;
            case 12:
                personVo.raceName = "白族";
                break;
            case 13:
                personVo.raceName = "土家族";
                break;
            case 14:
                personVo.raceName = "哈尼族";
                break;
            case 15:
                personVo.raceName = "哈萨克族";
                break;
            case 16:
                personVo.raceName = "傣族";
                break;
            case 17:
                personVo.raceName = "黎族";
                break;
            case 18:
                personVo.raceName = "傈僳族";
                break;
            case 19:
                personVo.raceName = "佤族";
                break;
            case 20:
                personVo.raceName = "畲族";
                break;
            case 21:
                personVo.raceName = "高山族";
                break;
            case 22:
                personVo.raceName = "拉祜族";
                break;
            case 23:
                personVo.raceName = "水族";
                break;
            case 24:
                personVo.raceName = "东乡族";
                break;
            case 25:
                personVo.raceName = "纳西族";
                break;
            case 26:
                personVo.raceName = "景颇族";
                break;
            case 27:
                personVo.raceName = "柯尔克孜族";
                break;
            case 28:
                personVo.raceName = "土族";
                break;
            case 29:
                personVo.raceName = "达斡尔族";
                break;
            case 30:
                personVo.raceName = "仫佬族";
                break;
            case 31:
                personVo.raceName = "羌族";
                break;
            case 32:
                personVo.raceName = "布朗族";
                break;
            case 33:
                personVo.raceName = "撒拉族";
                break;
            case 34:
                personVo.raceName = "毛南族";
                break;
            case 35:
                personVo.raceName = "仡佬族";
                break;
            case 36:
                personVo.raceName = "锡伯族";
                break;
            case 37:
                personVo.raceName = "阿昌族";
                break;
            case 38:
                personVo.raceName = "普米族";
                break;
            case 39:
                personVo.raceName = "朝鲜族";
                break;
            case 40:
                personVo.raceName = "塔吉克族";
                break;
            case 41:
                personVo.raceName = "怒族";
                break;
            case 42:
                personVo.raceName = "乌孜别克族";
                break;
            case 43:
                personVo.raceName = "俄罗斯族";
                break;
            case 44:
                personVo.raceName = "鄂温克族";
                break;
            case 45:
                personVo.raceName = "德昂族";
                break;
            case 46:
                personVo.raceName = "保安族";
                break;
            case 47:
                personVo.raceName = "裕固族";
                break;
            case 48:
                personVo.raceName = "京族";
                break;
            case 49:
                personVo.raceName = "塔塔尔族";
                break;
            case 50:
                personVo.raceName = "独龙族";
                break;
            case 51:
                personVo.raceName = "鄂伦春族";
                break;
            case 52:
                personVo.raceName = "赫哲族";
                break;
            case 53:
                personVo.raceName = "门巴族";
                break;
            case 54:
                personVo.raceName = "珞巴族";
                break;
            case 55:
                personVo.raceName = "基诺族";
                break;
            default:
                personVo.raceName = "汉族";
        }
        personVo.address = person.getAddress();
        personVo.state = person.getState();
        personVo.teacherName = person.getTeacherName();
        personVo.guardian = person.getGuardian();
        personVo.guardianContact = person.getGuardianContact();
        personVo.crimeTime = person.getCrimeTime();
        personVo.crimeType = person.getCrimeType();
        personVo.crimeDetail = person.getCrimeDetail();
        return personVo;
    }
}
